package com.bungarus.model;

import java.io.Serializable;
import java.util.List;

/**
 *
 * Created by tang on 2018/11/28.
 */
public class RetryFailedMessage implements Serializable {
    private long id;
    private String clusterTag;
    private String from;
    private String to;
    private String lang;
    private int type;
    private int priority;
    private int gaction;
    private int tenantID;
    private String dev;
    private String app;
    private long sentTime;
    private String content;
    private List<Expand> extensions;

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getClusterTag() {
        return clusterTag;
    }

    public void setClusterTag(String clusterTag) {
        this.clusterTag = clusterTag;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public String getLang() {
        return lang;
    }

    public void setLang(String lang) {
        this.lang = lang;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    public int getGaction() {
        return gaction;
    }

    public void setGaction(int gaction) {
        this.gaction = gaction;
    }

    public int getTenantID() {
        return tenantID;
    }

    public void setTenantID(int tenantID) {
        this.tenantID = tenantID;
    }

    public String getDev() {
        return dev;
    }

    public void setDev(String dev) {
        this.dev = dev;
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public long getSentTime() {
        return sentTime;
    }

    public void setSentTime(long sentTime) {
        this.sentTime = sentTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<Expand> getExtensions() {
        return extensions;
    }

    public void setExtensions(List<Expand> extensions) {
        this.extensions = extensions;
    }

    public static class Expand {
        private String key;
        private String value;

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }

    public static class Builder {

        private RetryFailedMessage message;

        public Builder() {
            this.message = new RetryFailedMessage();
        }

        public Builder id(long id) {
            this.message.setId(id);
            return this;
        }

        public Builder clusterTag(String clusterTag) {
            this.message.setClusterTag(clusterTag);
            return this;
        }

        public Builder from(String from) {
            this.message.setFrom(from);
            return this;
        }

        public Builder to(String to) {
            this.message.setTo(to);
            return this;
        }

        public Builder lang(String en) {
            this.message.setLang(en);
            return this;
        }

        public Builder type(int type) {
            this.message.setType(type);
            return this;
        }

        public Builder priority(int priority) {
            this.message.setPriority(priority);
            return this;
        }

        public Builder gaction(int gaction) {
            this.message.setGaction(gaction);
            return this;
        }

        public Builder tenant(int tenantID) {
            this.message.setTenantID(tenantID);
            return this;
        }

        public Builder dev(String dev) {
            this.message.setDev(dev);
            return this;
        }

        public Builder app(String app) {
            this.message.setApp(app);
            return this;
        }

        public Builder sentTime(long sentTime) {
            this.message.setSentTime(sentTime);
            return this;
        }

        public Builder content(String content) {
            this.message.setContent(content);
            return this;
        }

        public Builder extensions(List<Expand> expands) {
            this.message.setExtensions(expands);
            return this;
        }

        public RetryFailedMessage built() {
            return this.message;
        }
    }
}
